package com.kube.design.prototypepattern;

/**
 * @author q.zhangr
 * @version 1.0.0
 * @date 2020/7/22
 */
public class Client {


    /**
     * 测试类，客户端
     *
     * @param args
     */
    public static void main(String[] args) {
        WeeklyLog log1, log2;

        //创建原型对象
        log1 = new WeeklyLog();

        //创建附件对象
        Attachment attachment = new Attachment();

        //将附件添加到周报种去
        log1.setAttachment(attachment);
        //克隆周报
        log2 = log1.clone();
        System.out.println("周报是否相同" + (log1 == log2));
        System.out.println("附件是否相同" + (log1.getAttachment() == log2.getAttachment()));
    }
}
